/* eslint-disable */
<template>
  <div class="list-model">
    <div class="table-box">
      <el-table
        :data="list"
        size="mini"
        style="width: 100%"
        header-cell-style="background-color: #f7f7f7;"
      >
        <el-table-column
          prop="resourceNo"
          label="编号"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.resourceNo">{{scope.row.resourceNo}}</span>
            <div v-else>/</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="productName"
          label="资源名称"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.resourceNo">{{scope.row.productName}}</span>
            <div v-else>/</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="productSource"
          label="来源"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.resourceNo">{{scope.row.productSource===1?'个人':scope.row.productSource===2?'企业':'平台'}}</span>
            <div v-else>/</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="amount"
          label="应付金额(元)"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.resourceNo">{{scope.row.amount}}</span>
            <div v-else>/</div>
          </template>
        </el-table-column>
        <el-table-column
          prop="serviceRatio"
          label="平台服务费比例"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.resourceNo">{{scope.row.serviceRatio}}</span>
            <div v-else>/</div>
          </template>
        </el-table-column>
        <el-table-column label="金额(元)">
          <template slot-scope="scope">
            <span v-if="scope.row.resourceNo">{{(scope.row.amount*scope.row.serviceRatio).toFixed(2)}}</span>
            <div v-else>/</div>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
  import { mapActions } from 'vuex'

  export default {
    name: 'tenement-list',
    data () {
      return {
        list: []
      }
    },
    props: {
      tenementList: Array,
      pageNo: Number,
      pageSize: Number
    },
    methods: {
      ...mapActions('security', ['deleteQueue']),
      // eslint-disable-next-line
      _delete (item, i) {
        this.deleteQueue({
          id: item.id
        })
          .then((res) => {
            this.$emit('on-update')
            this.$message.success(res.msg)
          })
          .catch((e) => {
            this.$message.error(e.msg || '')
          })
      },
      // eslint-disable-next-line
      _edit (item) {
        // 跳转到订单详情页面
        this.$router.push({ path: `/operation/orderList/detail/${item.id}` })
      }
    },
    watch: {
      // eslint-disable-next-line
      tenementList (a) {
        this.list = []
        setTimeout(() => {
          this.list = a
        })
      }
    },
    // eslint-disable-next-line
    created () {
      this.list = this.tenementList
    },
    // eslint-disable-next-line
    mounted () { },
    components: {}
  }
</script>

<style lang="scss"  scoped>
.table-box {
  padding-left: 10px;
  border: none;
  // margin-bottom: 20px;
}
.cli {
  // margin-left: 12px;
  font-size: 14px;
  font-family: PingFang SC, PingFang SC-Regular;
  font-weight: 400;
  text-align: LEFT;
  color: #33317e;
  line-height: 20px;
  cursor: pointer;
}
.otherCli {
  width: 10px;
  margin-left: 12px;
  font-size: 14px;
  font-family: PingFang SC, PingFang SC-Regular;
  font-weight: 400;
  text-align: LEFT;
  color: #33317e;
  // background: #fff;
  line-height: 20px;
  border: 0;
  cursor: pointer;
}
</style>
